UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ASHs7XDAqTuHhd0WuxZKZXGYhGhkCSij5kle+bHqJ7A=' 
WHERE 
  key_id = '2192fe4a232da2bd4cc9ae9151004b12209a3ec0c864f93d39c21690dc975fbb' 
  AND (
    token = 'ASHs7XDAqTuHhd0WuxZKZXGYhGhkCSij5kle+bHqJ7A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019