UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H11cV3Ej0F2cgSvw4vAcvD6ntvHxhQodCYJbNbIvcHU='
WHERE
key_id = 'decb8a3b59cd34304c692c6e6f986da1e35378447367a6326975085dc478fe45'
AND (
token = 'H11cV3Ej0F2cgSvw4vAcvD6ntvHxhQodCYJbNbIvcHU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)