UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FebBnzMX0YA+Mj25AiGNhrXMQkMXPnNMkIFuG4H1VjU='
WHERE
key_id = 'ad0e1abfba83b3f2aaa10c9cadb7d3156d7f81d707416f46bcc100f7ea2f52e8'
AND (
token = 'FebBnzMX0YA+Mj25AiGNhrXMQkMXPnNMkIFuG4H1VjU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)