UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qKvNElA030nJpQOOu+0KV4G6Z2iR+DSBY6cuPdeURKM=' 
WHERE 
  key_id = 'feedc5746361ef480793ebe995b4579738915fb94627fd17b808ac3d76982a2e' 
  AND (
    token = 'qKvNElA030nJpQOOu+0KV4G6Z2iR+DSBY6cuPdeURKM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022