UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lBTgclJDo6YW3G6KHBH5wAA3E6utCU4L7ASP9XhGnFM=' 
WHERE 
  key_id = '541b90f740f883d6f418eb9d1bb2d17c61c83f4f3f25eac6367598f8c75657b9' 
  AND (
    token = 'lBTgclJDo6YW3G6KHBH5wAA3E6utCU4L7ASP9XhGnFM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026