UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+ogLXpz/3BbOvUXDBtBaN7tTzI03wWkjIDNBv28wBKs='
WHERE
key_id = 'c0c3da95d9d6d0580e59d22b8167fcb9e6582bb6978243433e33f36921dcd1e9'
AND (
token = '+ogLXpz/3BbOvUXDBtBaN7tTzI03wWkjIDNBv28wBKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)