UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G0/hv6TshC8kWJn8csoHv23mOeLDGF/VWB0GF92WWoI=' 
WHERE 
  key_id = '26faa0c165af2a2a422cf730e400916b681b687ab26ec7a7f22fcf4cb4482ff0' 
  AND (
    token = 'G0/hv6TshC8kWJn8csoHv23mOeLDGF/VWB0GF92WWoI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016