UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Md8UXA/Oa+z5/hT9tkROv5y5uTOk1v1G8hTJgguYis='
WHERE
key_id = '06351598cec96e4cdff79928a95580a8e22b6eac294700f7ad6c6be2a9326911'
AND (
token = '3Md8UXA/Oa+z5/hT9tkROv5y5uTOk1v1G8hTJgguYis='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)