UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iGj/MI33VN8Ud7LOIFgrBopVrpaJk7xBZ/rfF1qWgsk=' 
WHERE 
  key_id = '1e2ee8a3ce5697d32079c643a8b21e07b790c2b6a5d4de72151d995ef34ba33b' 
  AND (
    token = 'iGj/MI33VN8Ud7LOIFgrBopVrpaJk7xBZ/rfF1qWgsk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025