UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ttVpRzPjrsgqKCp37pj/KLT0FwadMTtwpeTIDlsWW5g='
WHERE
key_id = 'c0bad273e065f52192ce2d24d6e03c2408d20e9e4a3ef8b976be253d015b34f8'
AND (
token = 'ttVpRzPjrsgqKCp37pj/KLT0FwadMTtwpeTIDlsWW5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)