UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u9Nyq1OU8dOHT88RUwuwka5n1d20vtw0dXGpnhDbMZ0='
WHERE
key_id = '062084e9c29abb0725a6288eeb18e4c20e3cec4c7b2d2ccaec1051d27c75b567'
AND (
token = 'u9Nyq1OU8dOHT88RUwuwka5n1d20vtw0dXGpnhDbMZ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)