UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kyVS39mF/TWSPjHdgMnUj2q0zO+ji0Fp8g+O/Db2zbE=' 
WHERE 
  key_id = '388c118a3f509798b065d008dcad31129866a117d9dde9a04ca60626f625b01c' 
  AND (
    token = 'kyVS39mF/TWSPjHdgMnUj2q0zO+ji0Fp8g+O/Db2zbE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016