UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/itXK1ti9y/1vJEx68Muoyo9g4OykLsIEP0LvSj24yo='
WHERE
key_id = 'afe36e62bf570a6c9e02163080b5edbae46d5b5e0a0748539bccf15c1eebbde6'
AND (
token = '/itXK1ti9y/1vJEx68Muoyo9g4OykLsIEP0LvSj24yo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)