UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XJfXAu7yD1yg4qscm2Yu2aidyNKvrN57eLRuqh+uzlQ='
WHERE
key_id = 'c2d85cf35d6a4d02a228cdf811561d244e9356c619da7039d8abcd8389b2fb43'
AND (
token = 'XJfXAu7yD1yg4qscm2Yu2aidyNKvrN57eLRuqh+uzlQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)