UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rg6H/x3xtk9/760npcmMis4MrPGgCcTQrDeFEuCwRMA='
WHERE
key_id = '1c000dcfa4e0838b6190f88864d324405c210b0ddf810b176f7c3006ea350eb4'
AND (
token = 'Rg6H/x3xtk9/760npcmMis4MrPGgCcTQrDeFEuCwRMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)