UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FGtcXPTgQ01nO2TzLz3UzzdMw5HFofTRY3YuaXET+2c='
WHERE
key_id = '814791bbad8028c010fd4a1384955e3d51753e467900af31097a0386f99e44ac'
AND (
token = 'FGtcXPTgQ01nO2TzLz3UzzdMw5HFofTRY3YuaXET+2c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)