UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OrbX2LpX7H+fES+ro+fp6kahnp8wjs1MdUO3LFkJH5I='
WHERE
key_id = '1f3049bc5afe150e43d25a1211cd63ba731958da4e98fe29c4b701fafe8c1833'
AND (
token = 'OrbX2LpX7H+fES+ro+fp6kahnp8wjs1MdUO3LFkJH5I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)