UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LHFgIo7h+X++bfmcWbmH/t0Yt2JV/RN5ZGc7MKPkg8c='
WHERE
key_id = 'd8e9bc3fdc39b897cd43e14de5ee845c712d4d15e1df7963e3817db7707ae8ad'
AND (
token = 'LHFgIo7h+X++bfmcWbmH/t0Yt2JV/RN5ZGc7MKPkg8c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)