UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RVtwq/40Ov3mLqoiVoVW2W/DmplCAkkrk6c6NuXrOA8='
WHERE
key_id = '9cc46c22403410be5d943de5ff019256142c091e39780ecc6b44ec0c71113a06'
AND (
token = 'RVtwq/40Ov3mLqoiVoVW2W/DmplCAkkrk6c6NuXrOA8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)