UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S/AINEPwURoRofFULC38MGbet9bKaW6QvC+Lx4skmRE='
WHERE
key_id = '668ccba9e3603bb2b2d2c386be4928f95f1dc0e0b27065697c4a092dc2144346'
AND (
token = 'S/AINEPwURoRofFULC38MGbet9bKaW6QvC+Lx4skmRE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)