UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wTXzK2ngA9OC0pv/hgHByVvzbDz58F/f07RQjt4thok='
WHERE
key_id = '4346da00a9c73f78ce9ea7caa410a27885e330629cf1e83c4bb7d6fad814a854'
AND (
token = 'wTXzK2ngA9OC0pv/hgHByVvzbDz58F/f07RQjt4thok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)