UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ss6vU5fQNQzGu0kHYYkTcVeOrZUpL/mGqu7kTgPBxt8=' 
WHERE 
  key_id = 'a413497a2b9fe4ca0fe1305ef720dca44a76c1353e6da563b0fd1d8b064997f6' 
  AND (
    token = 'ss6vU5fQNQzGu0kHYYkTcVeOrZUpL/mGqu7kTgPBxt8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016