UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nXXA7N/XkTDa5AC8LGmN7Zf9wLCTDKdrUAk2OtTavTM=' 
WHERE 
  key_id = '2dbe4ac0f30224a69867edf5b7c90f6e973abdb8691294c61b2c6cae9c3d43af' 
  AND (
    token = 'nXXA7N/XkTDa5AC8LGmN7Zf9wLCTDKdrUAk2OtTavTM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037