UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4RXZlYSR6H3OWIzCP8Ctcax95cbR57fKvgthWUqjb7U=' 
WHERE 
  key_id = 'f22c00c9779c9ad0777e659af371e0a87b7d7abef97c0ab113e72d4a42061e47' 
  AND (
    token = '4RXZlYSR6H3OWIzCP8Ctcax95cbR57fKvgthWUqjb7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030