UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8gW9Lmd2uKh6vzhV+VffcKMJh7+NYJy4Mg4W+nVk/Ts='
WHERE
key_id = '5e7cfa2c8b2c09285e7ac73539a23089424390c90d55869ba75c6fe24d3bac75'
AND (
token = '8gW9Lmd2uKh6vzhV+VffcKMJh7+NYJy4Mg4W+nVk/Ts='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)