UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SGKenKZcsfVNMqnrEw2Lwe+e/IIMtUo1/vj1i9aK6x4='
WHERE
key_id = '978c0d48409e85559e2f10dbfaed4255ef290d6c4e6d1f68c7253bb87644eaee'
AND (
token = 'SGKenKZcsfVNMqnrEw2Lwe+e/IIMtUo1/vj1i9aK6x4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)