UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zIF96HmkYJhSg/dkn7fzFxDPTjODXTOr9x2tpCjWJWc=' 
WHERE 
  key_id = 'f8795826004512bc5f9953d1f89f5c24d792706c3e6a745c63c007d290aadaab' 
  AND (
    token = 'zIF96HmkYJhSg/dkn7fzFxDPTjODXTOr9x2tpCjWJWc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025