UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8EWIXxjyJm1TE4w7t46wXhfaCbcL6DsXxuXgg2J4yUM='
WHERE
key_id = 'b403e995abdef817faa1d7497198a0e695f6d71fa7f57861426e7cab569f0780'
AND (
token = '8EWIXxjyJm1TE4w7t46wXhfaCbcL6DsXxuXgg2J4yUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)