UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HoCAiUQwzckVPGrthUWlI7W7hugoymF9xRLwoDb0b3I=' 
WHERE 
  key_id = '75b223922dd598a86aa5c53d391aca1ecb3761228398881afab998df81930a6b' 
  AND (
    token = 'HoCAiUQwzckVPGrthUWlI7W7hugoymF9xRLwoDb0b3I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034