UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BVSM/i3cDftlQRO6av1H/ZR0y7ou63mSCO1NzVIsfVs='
WHERE
key_id = '0a7afa17eaf1cf8e36865aedd67e78f3f1f83ab346f473c2e2baa423547398ce'
AND (
token = 'BVSM/i3cDftlQRO6av1H/ZR0y7ou63mSCO1NzVIsfVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)