UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fLGWO+b2sIMo4M4IH1a+ur5ENwXlZj6341xJyiUMEcU='
WHERE
key_id = '4581fb85d0cf148acc1728f8661a5b1e75ef00e4cb2f8e7d860ff46403e0440f'
AND (
token = 'fLGWO+b2sIMo4M4IH1a+ur5ENwXlZj6341xJyiUMEcU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)