UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KPUu669nsy4diT1fRKhoDD4A6E2RUw6AsV+vRbhkj/8='
WHERE
key_id = '0bedcc30f4c35de1c458b8b300b33b35a04bb8eb8446f65eb34590b8f32f9a37'
AND (
token = 'KPUu669nsy4diT1fRKhoDD4A6E2RUw6AsV+vRbhkj/8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)