UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JAyVA+GsewXk9qQwoP/cbgJEaoo3VAAVaZCIzB84Tso='
WHERE
key_id = '2a624b7a40d07c75ffcc3a373dc3d41670a953fc7e2cd73ed982fe055616061f'
AND (
token = 'JAyVA+GsewXk9qQwoP/cbgJEaoo3VAAVaZCIzB84Tso='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)