UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U/QihlTz+oq/Ezktu4bp7PL0qa4iwrXmGRQDTGQx2Po='
WHERE
key_id = '084de49ccc4c1e1b674fe5ab296c3b15297e44140dcf880c79c617b9f5cc65ce'
AND (
token = 'U/QihlTz+oq/Ezktu4bp7PL0qa4iwrXmGRQDTGQx2Po='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)