UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qvJI0Qz9VJEMbJ22my9S5rL0Yh6MZIeXVN9Cze/E0K4='
WHERE
key_id = '7b453734f553de5e44afa226d3ec8ae3ae3499c24df5233fac8c5f27d5ba5963'
AND (
token = 'qvJI0Qz9VJEMbJ22my9S5rL0Yh6MZIeXVN9Cze/E0K4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)