UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pP8l2H22e8PFY7TFCsB+5aKwufcZUD7aTxJRsx0Cg7E='
WHERE
key_id = 'ea34c0ad43e150f3b9933b5b746f8672dc6ad4e5297f938182f2b07c4fc08455'
AND (
token = 'pP8l2H22e8PFY7TFCsB+5aKwufcZUD7aTxJRsx0Cg7E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)