UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pQrjNu3EFV/Wg80BScctfTi3x/6SNaNflQAyknX/9pY=' 
WHERE 
  key_id = '850859fec047d23972106ddfb896a010474c72870c37811615708b110d773a09' 
  AND (
    token = 'pQrjNu3EFV/Wg80BScctfTi3x/6SNaNflQAyknX/9pY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067