UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LwKbSDfphPvfec0YOt/d3DAHn2VFaghfM6VdDLIn1us=' 
WHERE 
  key_id = 'cc490dc50478e95d94e940dba4335fc0bfb803c1bd0bea4f04c5a967985eb512' 
  AND (
    token = 'LwKbSDfphPvfec0YOt/d3DAHn2VFaghfM6VdDLIn1us=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028