UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y9JXxsaQE8B4C4D36NdnZAZkL96XnCXLxrjRmTr29E0=' 
WHERE 
  key_id = '5cbf4db5b8903659afb4d79c4d19121c3efee195fb2019ae611d49ed2fc5f4b5' 
  AND (
    token = 'y9JXxsaQE8B4C4D36NdnZAZkL96XnCXLxrjRmTr29E0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024