UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '77oB/2Nm9F8DG0QBXuyHW+Z3iAafc4RlJkGHY0mKGSA='
WHERE
key_id = '579aec062fb97120235333682cd741b820a28ceee6b96dcfb4aaef7e1b6d4035'
AND (
token = '77oB/2Nm9F8DG0QBXuyHW+Z3iAafc4RlJkGHY0mKGSA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)