UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JUTOKEJwgtntE/Lo96RkO6aZtMYCDzWD6aeTIn6Jh+8=' 
WHERE 
  key_id = '5e24bb36c42e605ed3f4b07fcfebda53465ddaa62fb27a248f95d2d7c12993f7' 
  AND (
    token = 'JUTOKEJwgtntE/Lo96RkO6aZtMYCDzWD6aeTIn6Jh+8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00011