UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z44XFAq5XdAemiISC7GwuRbt1sdeVAK5ChbxcLMQxIk=' 
WHERE 
  key_id = '2bc9571dd28e6e84bfb15fd0a2c3a809c21469d22a46b8cda1a5366ad15c966d' 
  AND (
    token = 'Z44XFAq5XdAemiISC7GwuRbt1sdeVAK5ChbxcLMQxIk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034