UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wU0C7Fg77fUG+oYYYJkcg0nuoKvFnmCZJYkqVHcIvxc='
WHERE
key_id = 'bc62ecbaf2cedaaa357fb60452d73ea273d91d6aac26889cf3920fadc76c0eee'
AND (
token = 'wU0C7Fg77fUG+oYYYJkcg0nuoKvFnmCZJYkqVHcIvxc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)