UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ig+QF22vRavmJyYaokSs49dSMMSDqzJ4Z0w662z0WaM='
WHERE
key_id = '30c1f85aa2e96e156316434ccd930b3d8858cedfdd32a3909cfe8818a4300ef8'
AND (
token = 'ig+QF22vRavmJyYaokSs49dSMMSDqzJ4Z0w662z0WaM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)