UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+gkG2ApkrL/1BnGaUS4x9bw/rWRO6kM1Vhmv2kDxgBs='
WHERE
key_id = 'da23b7233c51a082f47c203bf5e7d50e62f6185c33d1870006781a97db75d060'
AND (
token = '+gkG2ApkrL/1BnGaUS4x9bw/rWRO6kM1Vhmv2kDxgBs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)