UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vNGKxdJciHwduy9Pi8sug3wDHM64yTilPtVDBTjCAgQ='
WHERE
key_id = '976fbdb4419755e89203a7bbf776b457fbe94993a983a9cbdb48c222f62a5ad6'
AND (
token = 'vNGKxdJciHwduy9Pi8sug3wDHM64yTilPtVDBTjCAgQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)