UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DWdVpT9+5EvnryndSWrC2zg1IuCevLI5LnE/JKPpl3M='
WHERE
key_id = '7a5e3fdfd0197fd5bc9f626d3897765584d44d2573d801c23fd6b912028cc037'
AND (
token = 'DWdVpT9+5EvnryndSWrC2zg1IuCevLI5LnE/JKPpl3M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)