UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1z7fB/hanktqMfMtSXgbYEWNTKxtmXrZGYxdg3zlgqY=' 
WHERE 
  key_id = 'db833a7363284be26f00810f02e9b036c7bae409da41c5fc3a875e67d6fa34bb' 
  AND (
    token = '1z7fB/hanktqMfMtSXgbYEWNTKxtmXrZGYxdg3zlgqY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028